
<% breadcrumb :users %>

<div class="page-header">
  <h3>用户列表</h3>
</div>

<div class="well well-sm">
  <%= search_form_for [:admin, @q], :class => "form-inline" do |f| %>

    <div class="form-group">
      <%= f.label :login_cont, "登录名" %>
      <%= f.search_field :login_cont, :class => "form-control" %>
    </div>

    <div class="form-group">
      <%= f.label :name_cont, "昵称" %>
      <%= f.search_field :name_cont, :class => "form-control" %>
    </div>

    <%= f.submit "搜索", :class => "btn btn-primary" %>
  <% end %>
</div>

<table class="table table-hover table-condensed table-bordered">
  <thead>
    <td>ID</td>
    <td>登录名</td>
    <td>昵称</td>
    <td>创建时间</td>
    <td><%= link_to "新建用户", new_admin_user_path, :class => "btn btn-success" %></td>
  </thead>
  <tbody>
    <% @users.each do |user| %>
      <tr>
        <td><%= user.id %></td>
        <td><%= link_to user.login, admin_user_path(user) %></td>
        <td><%= user.name %></td>
        <td><%= short_datetime user.created_at %></td>
        <td>
          <%= link_to edit_admin_user_path(user) do %>
            <i class="fa fa-edit"></i> 修改资料
          <% end %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>